package com.kaochong.xcx.service;

import com.kaochong.xcx.entity.UserMistakes;
import com.kaochong.xcx.pojo.vo.ReviewWordVO;
import com.kaochong.xcx.web.aspect.CurrentUser;

import java.util.List;

/**
 * @author han
 * @date 2018-06-07 17:53
 */
public interface UserMistakesService {
	
	/**
	 * 用户需要复习的错题
	 * @param userId
	 * @param targetMarkId
	 * @param status
	 * @param errorTimes
	 * @return
	 */
	List<UserMistakes> findUserReviewMistakes(Long userId, String targetMarkId, Integer status,
	                                          Integer errorTimes, Integer target);
	
	/**
	 * 查询用户前两阶段的错题
	 * @param userId
	 * @param targetMarkId
	 * @param status
	 * @param currStage
	 * @param errorTimes
	 * @return
	 */
	List<UserMistakes> findBeforeTwoDayMistakes(Long userId, String targetMarkId, Integer status,
	                                            Integer currStage, Integer errorTimes, Integer target);
	
	/**
	 * 用户所有错题
	 * @param userId
	 * @param targetMarkId
	 * @return
	 */
	List<UserMistakes> findAllMistakes(Long userId, String targetMarkId, Integer target);
	
	/**
	 * 删除用户错题
	 * @param userId
	 * @param targetMarkId
	 * @return
	 */
	Integer deleteUserMistakes(Long userId, String targetMarkId, Integer target);
	
	/**
	 * 新增错题
	 * @param mistakesAll
	 * @param target
	 */
	void save(List<UserMistakes> mistakesAll, Integer target);
	
	/**
	 * 错词复习
	 * @param user
	 * @param stage
	 * @return
	 */
	List<ReviewWordVO> reviewMistakes(CurrentUser user, Integer stage);
	
	/**
	 * 错词数量
	 * @param user
	 * @param stage
	 * @return
	 */
	Integer reviewMistakesCount(CurrentUser user, Integer stage);
}
